import com.spring.config.MyConfig;
import com.spring.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author:liuwei
 * @creatdate:2021-07-13-9:17
 */
public class Mytest {
	public static void main(String[] args) {
		//如果完全使用注解方式去做，只能通过使用AnnotationConfig上下文来获取容器，通过配置class对象来加载
		ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
		User getUser = context.getBean("getUser", User.class);
		System.out.println(getUser.getName());
	}
}
